# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cargo-bloat
pkgver=0.12.0
pkgrel=0
pkgdesc="Find out what takes most of the space in your Rust executable"
url="https://github.com/RazrFalcon/cargo-bloat"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"  # limited by rust/cargo
license="MIT"
depends="cargo cargo-auditable"
source="https://github.com/RazrFalcon/cargo-bloat/archive/v$pkgver/cargo-bloat-$pkgver.tar.gz"

_cargo_opts="--frozen --features regex-filter"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -Dm755 target/release/cargo-bloat -t "$pkgdir"/usr/bin/
}

sha512sums="
ae28ee5a179745b76b358c39984184a6b36fa5e5486749f0c1e750b25fb75ac1745eefa5c6fae5b4200ce9e6304d29c075bee2f76cc549e921b385c56c5b0a03  cargo-bloat-0.12.0.tar.gz
"
